﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:fx="clr-namespace:Odyssey.Effects" xmlns:mwt="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
        xmlns:odc="clr-namespace:Odyssey.Controls">

    <LinearGradientBrush x:Key="{ComponentResourceKey odc:Skins, RibbonToolTipBackground}" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFF" Offset="0" />
        <GradientStop Color="#FFC9D9EF" Offset="1" />
    </LinearGradientBrush>

    <ControlTemplate x:Key="RibbonToolTipControlTemplate" TargetType="{x:Type odc:RibbonToolTip}">
        <mwt:SystemDropShadowChrome Margin="0,0,5,5" Color="#41000000" Name="Shdw" CornerRadius="4">
            <Border BorderBrush="Gray" BorderThickness="1" CornerRadius="3" Background="{TemplateBinding Background}">
                <Grid Margin="4">
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.ColumnSpan="2" Text="{TemplateBinding Title}" FontWeight="Bold" Margin="0,0,0,4" />
                    <Image Grid.Row="1" Grid.Column="0" Source="{TemplateBinding Image}" Stretch="None" Margin="4" VerticalAlignment="Top" />
                    <TextBlock Grid.Row="1" Grid.Column="1" Text="{TemplateBinding Description}" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Margin="4"
                            VerticalAlignment="Top" />
                    <StackPanel x:Name="separator" Grid.Row="2" Grid.ColumnSpan="2">
                        <Border BorderBrush="{DynamicResource {ComponentResourceKey odc:Skins, DefaultBorderBrush}}" BorderThickness="0,1,0,0" />
                        <Border Margin="0,1,0,0" BorderBrush="White" BorderThickness="0,1,0,0" />
                    </StackPanel>

                    <StackPanel Grid.Row="3" Grid.ColumnSpan="2" Orientation="Horizontal">
                        <Image Source="{TemplateBinding FooterImage}" Stretch="None" VerticalAlignment="Center" />
                        <TextBlock Text="{TemplateBinding Footer}" Margin="4" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap"
                                FontWeight="Bold" />
                    </StackPanel>
                </Grid>
            </Border>
        </mwt:SystemDropShadowChrome>
        <ControlTemplate.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="Footer" Value="{x:Null}" />
                    <Condition Property="FooterImage" Value="{x:Null}" />
                </MultiTrigger.Conditions>
                <Setter TargetName="separator" Property="Visibility" Value="Collapsed" />
            </MultiTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="{x:Type odc:RibbonToolTip}">
        <Setter Property="MaxWidth" Value="320" />
        <Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey odc:Skins, DefaultBorderBrush}}" />
        <Setter Property="Template" Value="{StaticResource RibbonToolTipControlTemplate}" />
        <Setter Property="Background" Value="{DynamicResource {ComponentResourceKey odc:Skins, RibbonToolTipBackground}}" />
    </Style>

</ResourceDictionary>